﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogicLayer;

namespace logicunivesityinventorystore.Store
{
    //public enum UIMODE
    //{
    //    NEW,
    //    EDIT,
    //    VIEW
    //}
    public partial class ItemsPopUp : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            //s btnOkay.Attributes.Add("onClick", "okay();");
            //  btnOkay.Attributes.Add("onClick", "okay();");
            if (!IsPostBack)
            {

                DropDownList1.DataSource = new ItemFacade().FindAllCategory();
                DropDownList1.DataTextField = "CategoryName";
                DropDownList1.DataValueField = "CategoryID";
                DropDownList1.DataBind();
                MultiViewExpanse.ActiveViewIndex = 0;
            }
        }
        private void LoadExpanse()
        {

        }

        protected void lnkAddAnother_Click(object sender, EventArgs e)
        {
        }

        protected void btnOkay_Click(object sender, EventArgs e)
        {


            foreach (GridViewRow row in GridView1.Rows)
            {
                CheckBox chk = (CheckBox)row.FindControl("CheckBox1");
                Label lbl = (Label)row.FindControl("Label1");
                Label lb2 = (Label)row.FindControl("Label2");
                if (chk.Checked)
                {
                    System.Collections.ArrayList arrl = (System.Collections.ArrayList)Session["selected"];
                    arrl.Add(lbl.Text);
                    Session["selected"] = arrl;
                   

                }
            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Call my function", "okay()", true);

        }

        private void UpdateExpanse()
        {


        }

        private void AddExpanse()
        {

        }
    }
}